package com.cheng.example.book.advise151.chap4;

import java.io.UnsupportedEncodingException;

public class Client58 {
    public static void main(String[] args) throws UnsupportedEncodingException {
        String str = "汉字";
        // 读取字节
//        byte b[] = str.getBytes("UTF-8");
        byte b[] = str.getBytes("GB2312");
        // 重新生成一个新的字符串
//        System.out.println(new String(b));
        System.out.println(new String(b,"GB2312"));
    }
}
